package com.lcxw.hxzbapi.service;

import java.util.List;
import javax.annotation.Resource;

import com.lcxw.hxzbapi.entity.requestBean.GetVoiceRoomParkReq;
import org.springframework.stereotype.Component;
import com.lcxw.hxzbapi.dao.mapper.YwpdRoomMapper;
import com.lcxw.hxzbapi.entity.pojo.YwpdRoom;

/**
 * @author lcxw
 */
@Component
public class YwpdRoomService {

    @Resource
    YwpdRoomMapper ywpdRoomMapper;

    public int createYwpdRoom(YwpdRoom ywpdRoom) throws Exception {
        return ywpdRoomMapper.insert(ywpdRoom);
    }

    public YwpdRoom selectRoomByRoomId(long roomId) {
        return ywpdRoomMapper.selectRoomByRoomId(roomId);
    }

    public YwpdRoom selectRoomByUserId(long userId) {
        return ywpdRoomMapper.selectRoomByUserId(userId);
    }

    public int selectRoomCountOfUnion(long unionId) throws Exception {
        return ywpdRoomMapper.selectRoomCountOfUnionId(unionId);
    }

    public int updateRoom(YwpdRoom ywpdRoom) throws Exception {
        return ywpdRoomMapper.updateRoomByRoomId(ywpdRoom);
    }

    public List<Long> selectAllRoomId() {
        return ywpdRoomMapper.selectAllRoomId();
    }

    public List<YwpdRoom> selectLivingRoomByRoomType(String roomType) throws Exception {
        return ywpdRoomMapper.selectLivingRoomByRoomType(roomType);
    }

    public List<YwpdRoom> selectAllLivingRoom() {
        return ywpdRoomMapper.selectAllLivingRoom();
    }

    public List<YwpdRoom> selectAllLivingRoomWitPage(int pageNum, int pageSize) {
        return ywpdRoomMapper.selectAllLivingRoomWitPage(pageNum, pageSize);
    }

    public List<YwpdRoom> selectLivingVoiceRoomWitPage(int pageNum, int pageSize) {
        return ywpdRoomMapper.selectLivingVoiceRoomWitPage(pageNum, pageSize);
    }

    public List<YwpdRoom> selectLivingVoiceRoom(GetVoiceRoomParkReq data) {
        return ywpdRoomMapper.selectLivingVoiceRoom(data);
    }


    public List<YwpdRoom> selectLivingVideoRoomWitPage(String liveType, int pageNum, int pageSize) {
        return ywpdRoomMapper.selectLivingFullVideoRoomWitPage(liveType, pageNum, pageSize);
    }

    public int selectCountAllLivingRoom() {
        return ywpdRoomMapper.selectCountAllLivingRoom();
    }

    public List<Long> selectAllLivingRoomId() {
        return ywpdRoomMapper.selectAllLivingRoomId();
    }
}
